package com.ny.mapper;

import com.ny.entity.Classrooms;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ClassroomMapper {
    //编写方法
    //返回值类型:int String double 对象类型  集合类型
    //返回值类型：sql语句执行的结果
    //参数：看sql的条件
    List<Classrooms> findAllClassrooms();

//多条件查询教室
    List<Classrooms> searchClassrooms(
            @Param("classroomName") String classroomName,
            @Param("capacity") String capacity,
            @Param("status") String status,
            @Param("building") String building,
            @Param("description") String description);


    // 根据教室 ID 更新教室状态
    @Insert(" UPDATE classrooms SET status = #{status} WHERE classroom_id = #{classroomId}")
    void updateClassroomStatusById(@Param("classroomId") int classroomId,
                                   @Param("status") String status);


}
